function [value,isterminal,direction] = events2(t,z)


global par g_T2

k = z(1);
f = z(5);

value = g_T2 - (par.A-par.delta)/(par.a*k+par.F0-par.a*f);

isterminal = 1;   % Stop the integration
direction = -1;   % it's initially positive and decreasing to zero
